package com.opgea.tutor.web.dto;

import java.io.Serializable;

import com.opgea.tutor.domain.entities.Address;
import com.opgea.tutor.domain.interfaces.Marshallable;

public class AddressDTO implements Serializable, Marshallable<Address> {

    /**
     * 
     */
    private static final long serialVersionUID = -846553143892895097L;
    private long id;
    private String addressLine1;
    private String addressLine2;
    private String province;
    private String city;
    private String zipCode;
    private String landMark;

    public long getId() {
	return id;
    }

    public void setId(long id) {
	this.id = id;
    }

    public String getAddressLine1() {
	return addressLine1;
    }

    public void setAddressLine1(String addressLine1) {
	this.addressLine1 = addressLine1;
    }

    public String getAddressLine2() {
	return addressLine2;
    }

    public void setAddressLine2(String addressLine2) {
	this.addressLine2 = addressLine2;
    }

    public String getProvince() {
	return province;
    }

    public void setProvince(String province) {
	this.province = province;
    }

    public String getCity() {
	return city;
    }

    public void setCity(String city) {
	this.city = city;
    }

    public String getZipCode() {
	return zipCode;
    }

    public void setZipCode(String zipCode) {
	this.zipCode = zipCode;
    }

    public String getLandMark() {
	return landMark;
    }

    public void setLandMark(String landMark) {
	this.landMark = landMark;
    }

    @Override
    public void marshall(Address address) {
	if (address != null) {
	    this.addressLine1 = address.getAddressLine1();
	    this.addressLine2 = address.getAddressLine2();
	    this.city = address.getCity();
	    this.province = address.getProvince();
	    this.zipCode = address.getZipCode();
	    this.setLandMark(address.getLandMark());
	}
    }

    @Override
    public Object unmarshall(Address address) {
	if (address != null) {
	    address.setAddressLine1(this.addressLine1);
	    address.setAddressLine2(this.addressLine2);
	    address.setCity(this.city);
	    address.setProvince(this.province);
	    address.setZipCode(this.zipCode);
	    address.setLandMark(this.landMark);
	}
	return address;
    }
}
